﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QGridLayout>
#include "httpform.h"
#include "tcpform.h"
#include "udpform.h"
#include <QSystemTrayIcon>
#include <QCloseEvent>
#include <QMessageBox>
#include <QLabel>
#include <QTimer>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

protected:
    void closeEvent(QCloseEvent *event);

private:
    Ui::MainWindow *ui;
    QTabWidget *m_tabWidget;
    HttpForm *m_pHttpForm;
    TcpForm *m_pTcpForm;
    UdpForm *m_pUdpForm;

    QSystemTrayIcon *m_pSystemTrayIcon;
    QAction *m_pShowNormalAction; //恢复
    QAction *m_pAboutAction;
    QAction *m_pQuitAction; //退出
    QMenu *m_pContextMenu;

    QLabel *m_pCurrentTime;
    QTimer *m_pTimer;

private slots:
    void on_about();
    void on_activatedSysTrayIcon(QSystemTrayIcon::ActivationReason reason);
};
#endif // MAINWINDOW_H
